<template>
  <div class="">
    <van-tabbar v-model="active">
      <van-tabbar-item replace to="/pages/bIndex">
        <span>商城</span>
        <template #icon="props">
          <img :src="props.active==1 ? icon.active : icon.inactive" />
        </template>
      </van-tabbar-item>
      <van-tabbar-item icon="search" replace to="/pages/bShopIndex">店铺</van-tabbar-item>
      <van-tabbar-item icon="setting-o" replace to="/pages/bPersonalCenter">我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
import { Tabbar, TabbarItem } from "vant";
export default {
  name: "App",
  data() {
    return {
      active: 1,
      icon: {
        active: "/src/assets/tabbar1.1.png",
        inactive: "/src/assets/tabbar1.2.png",
        // active: "https://img01.yzcdn.cn/vant/user-active.png",
        // inactive: "https://img01.yzcdn.cn/vant/user-inactive.png",
      },
    };
  },
  mounted() {
    document.querySelector("body").setAttribute("style", "background-color:#F2F4FA");
  },
  methods: {
    jumpBanner() {
      this.$router.push({
        path: "/pages/bannerInfo",
        query: {
          //传递参数
        },
      });
    },
  },
  created() {},
  components: {
    [Tabbar.name]: Tabbar,
    [TabbarItem.name]: TabbarItem,
  },
};
</script>

<style scoped></style>
